﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LeftTree.aspx.cs" Inherits="Web.Views.SystemLogin.LeftTree" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <%--<title>东方OA左侧导航菜单</title>
	<link href="../../Styles/Main.CSS" type="text/css" rel="stylesheet" />

	<style type="text/css">
	    #tvModule a:linl,#tvModule a:active,#tvModule a:visited
	    {
	         text-decoration:none;
	         color:Black;
	    }
	    #tvModule a:hover
	    {
	        color:Blue;
	    }
	    
	    .node_default
	    {
	        font-size:12px;font-family:Arial; color:Black;
	    }
	    .node_hover
	    {
	        Color:Black;background-color:#FDF4A2;
	    }
	.node_select
	{
	    Color:White;background-color:#333333;
	}
	</style>--%>
	
	    <link href="../../ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
	        <script src="../../Javascript/jquery-1.5.2.min.js" type="text/javascript"></script>
	            <%--<script src="../../Javascript/RiaFrame_Layout.js" type="text/javascript"></script>--%>
    <script src="../../ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            GetNavigateContent("");
        });
         function GetNavigateContent(_parentId) {
             var menu = $('.treemenu');
             menu.append("<ul class=\"menu_lv1\"></ul>");
             $.ajax(
    {
        type: "POST",
        url: 'GetCommanMenuById.ashx?parentId=' + _parentId,
        success: function(result) {
            //添加分类菜单
            if (result.toString().toLowerCase() == "empty")//如果返回的是字符串"Empty"，表示是叶节点，不再继续加载
            {
                return false;
            }
            else if (result.toString().indexOf('<html>') > 0) {//包含<html>标签的是表示错误页面，不加载
                return false;
            }
            else {
                var list = eval(result);
                var _data = [];
                $(list).each(function(i, item) {
                    var treenode = new TreeNodeData();
                    treenode.id = item.id;
                    treenode.pid = item.pid;
                    treenode.text = item.text;
                    treenode.attribute = item.attribute;
                    if (treenode.pid != "0") {
                        treenode.isexpand = false;
                    }
                    else {
                        treenode.isexpand = true;
                    }
                    _data.push(treenode);
                });

                var ajaxTree = menu.find('.menu_lv1');
                ajaxTree.ligerTree({
                    checkbox: false,
                    data: _data,
                    attribute: ['url'],
                    idFieldName: 'id',
                    parentIDFieldName: 'pid',
                    onSelect: function(node) {
                        if (node.data.attribute[0].url != "") {
                            var url = node.data.attribute[0].url;
                            parent.document.location = url;
                        }
                    }
                });
            }
        }
    });
         }

        function TreeNodeData() {
            this.id;
            this.pid;
            this.text;
            this.isexpand;
            this.attribute;
        }
    </script>
</head>
<body >
    <%--<form id="Form1" method="post" runat="server" style="margin: 0px">    
       <div>
       <asp:TreeView ID="tvModule" runat="server" 
       NodeStyle-ImageUrl="../../Images/tree/icon/folder.gif"
         ShowExpandCollapse="true"  Target="main" EnableViewState="false" ExpandDepth="1"
         NodeStyle-CssClass="node_default"
          HoverNodeStyle-CssClass="node_hover"          
          SelectedNodeStyle-CssClass="node_select"></asp:TreeView>
       </div>
    </form>--%>
<div  class="treemenu " style=" height:100%; background-color: White; ">
				
			</div>
    

</body>
</html>
